﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace LevenBlog.Core.Data
{
    public interface IDbProvider : IDisposable
    {
        string ConnectionString { get; }

        uint QueryNum { get; }

        IDbConnection Connection { get; }

        IDbCommand Command { get; }

        IDbDataAdapter DataAdapter { get; }

        void AddQuery();

        void Open();

        void Close();

        #region 事务控制

        bool IsInTracsaction { get; }

        void BeginTransaction();

        void BeginTransaction(IsolationLevel level);

        void Commit();

        void Rollback();

        #endregion

        #region Instance

        IDbProvider CreateInstance();

        #endregion
    }
}
